package tablesqls

func CreateMenuActionTableSql() (sql string) {
	sql = `
		CREATE TABLE menu_action (
			id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
			menu_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '菜单栏ID',
			method varchar(30) NOT NULL DEFAULT '' COMMENT '请求方式',
			api varchar(100) NOT NULL DEFAULT '' COMMENT '请求地址',
			is_deleted tinyint(1) NOT NULL DEFAULT '-1' COMMENT '是否删除 1:是  -1:否',
			created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
			created_user varchar(60) NOT NULL DEFAULT '' COMMENT '创建人',
			updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
			updated_user varchar(60) NOT NULL DEFAULT '' COMMENT '更新人',
			PRIMARY KEY (id),
			KEY idx_menu_id (menu_id)
			) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='功能权限表';
			`
	return
}

func CreateMenuActionTableDataSql() (sql string) {
	sql = `
		INSERT INTO menu_action (id, menu_id, method, api, created_user) VALUES
		 (1, 17, 'GET', '/api/tool/hashids/**', 'init'),
		 (2, 14, 'POST', '/api/tool/cache/search', 'init'),
		 (3, 14, 'PATCH', '/api/tool/cache/clear', 'init'),
		 (4, 15, 'GET', '/api/tool/data/dbs', 'init'),
		 (5, 15, 'POST', '/api/tool/data/mysql', 'init'),
		 (6, 15, 'POST', '/api/tool/data/tables', 'init'),
		 (7, 2, 'PATCH', '/api/config/email', 'init'),
		 (8, 5, 'POST', '/generator/gorm/execute', 'init'),
		 (9, 6, 'POST', '/generator/handler/execute', 'init'),
		 (10, 8, 'GET', '/authorized/add', 'init'),
		 (11, 8, 'GET', '/authorized/api/*', 'init'),
		 (12, 8, 'GET', '/api/authorized', 'init'),
		 (13, 8, 'PATCH', '/api/authorized/used', 'init'),
		 (14, 8, 'DELETE', '/api/authorized/*', 'init'),
		 (15, 8, 'POST', '/api/authorized', 'init'),
		 (16, 8, 'GET', '/api/authorized_api', 'init'),
		 (17, 8, 'POST', '/api/authorized_api', 'init'),
		 (18, 8, 'DELETE', '/api/authorized_api/*', 'init'),
		 (19, 11, 'GET', '/admin/add', 'init'),
		 (20, 11, 'POST', '/api/admin', 'init'),
		 (21, 11, 'GET', '/api/admin', 'init'),
		 (22, 11, 'PATCH', '/api/admin/used', 'init'),
		 (23, 11, 'PATCH', '/api/admin/reset_password/*', 'init'),
		 (24, 11, 'DELETE', '/api/admin/*', 'init'),
		 (25, 11, 'GET', '/admin/action/*', 'init'),
		 (26, 11, 'GET', '/api/admin/menu/*', 'init'),
		 (27, 11, 'POST', '/api/admin/menu', 'init'),
		 (28, 12, 'GET', '/admin/menu_action/*', 'init'),
		 (29, 12, 'GET', '/api/menu', 'init'),
		 (30, 12, 'DELETE', '/api/menu/*', 'init'),
		 (31, 12, 'GET', '/api/menu/*', 'init'),
		 (32, 12, 'PATCH', '/api/menu/used', 'init'),
		 (33, 12, 'POST', '/api/menu', 'init'),
		 (34, 12, 'GET', '/api/menu_action', 'init'),
		 (35, 12, 'POST', '/api/menu_action', 'init'),
		 (36, 12, 'DELETE', '/api/menu_action/*', 'init'),
		 (37, 22, 'POST', '/upgrade/execute', 'init'),
		 (38, 11, 'PATCH', '/api/admin/offline', 'init'),
		 (39, 12, 'PATCH', '/api/menu/sort', 'init'),
		 (40, 24, 'GET', '/cron/add', 'init'),
		 (41, 24, 'GET', '/cron/edit/*', 'init'),
		 (42, 24, 'POST', '/api/cron', 'init'),
		 (43, 24, 'POST', '/api/cron/*', 'init'),
		 (44, 24, 'GET', '/api/cron', 'init'),
		 (45, 24, 'GET', '/api/cron/*', 'init'),
		 (46, 24, 'PATCH', '/api/cron/used', 'init'),
		 (47, 24, 'PATCH', '/api/cron/exec/*', 'init'),
		 (48, 25, 'POST', '/api/tool/send_message', 'init');
		`
	return
}
